{# 超链接 #}
{% macro url(path, params) %}
  {% set query = [] %}
  
  {% if params %}
    {% for name, value in params %}
      {% if value !== undefined %}
        {% set query[query.length] = name + '=' + value|url_encode %}
      {% endif %}
    {% endfor %}
  {% endif %}

  {% if query.length %}
    {{ path }}?{{ query|join('&amp;') }}
  {% else %}
    {{ path }}
  {% endif %}
{% endmacro %}

{# 新版底部菜单 #}
{% macro footbar(type) %}
  <footer class="bar bar-footer bar-fixed">
    <a class="item {% if type === 'home' %}active{% endif %}" href="/home">
      <i class="icon">&#xe62a;</i>
      <span>首页</span>
    </a>
    <a class="item {% if type === 'assistant' %}active{% endif %}" href="/assistant">
      <i class="icon">&#xe617;</i>
      <span>管家</span>
    </a>
    <a class="item {% if type === 'profile' %}active{% endif %}" href="/profile">
      <i class="icon">&#xe609;</i>
      <span>我的</span>
    </a>
  </footer>
{% endmacro %}

{% macro back(path) %}
  {% if path %}
    <a href="{{ path }}"><i class="icon">&#xe60e;</i></a>
  {% else %}
    <a href="javascript:history.go(-1);"><i class="icon">&#xe60e;</i></a>
  {% endif %}
{% endmacro %}